from schema import Schema, Optional, Use, Or, And

product_post_schema = Schema(
    {

        'bar_code': str,
        Optional('vendor_name'): Or(None, str),
        Optional('ware_id'): Or(None, str),
        Optional('brand'): Or(None, str),
        Optional('region'): Or(None, str),
        Optional('weight'): Or(None, Use(float)),
        Optional('tax_rate'): Or(None, Use(float)),
        Optional('seo_info'): Or(None, str),
        Optional('packing'): Or(None, str),
        Optional('properties'): Or(None, str),
        Optional('name'): Or(None, str)

    }
)

product_patch_schema = Schema(
    {
        Optional('vendor_name'): Or(None, str),
        Optional('ware_id'): Or(None, str),
        Optional('brand'): Or(None, str),
        Optional('region'): Or(None, str),
        Optional('weight'): Or(None, Use(float)),
        Optional('tax_rate'): Or(None, Use(float)),
        Optional('seo_info'): Or(None, str),
        Optional('packing'): Or(None, str),
        Optional('properties'): Or(None, str),
        Optional('name'): Or(None, str)

    }
)
